<?php
setlocale(LC_ALL, 'zh_CN.utf-8');
header("Content-Type:text/html;charset=utf-8");

$cate = isset($_GET['cate']) ? intval($_GET['cate']) : '';


require_once 'class/material.class.php';


$materialClass= new materialClass();

$total=$materialClass->getCount2($cate);



$data["total"] = $total;  

$items = $materialClass->getAll2($cate);

$data["rows"] = $items;   
$json= json_encode($items); 
echo $json; 
?>